﻿namespace AppLibrary.Storage
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.ServiceModel.Syndication;

    public interface ISyndicationProvider
    {
        IQueryable<SyndicationItem> Items { get; }
        IQueryable<SyndicationCategory> Categories { get; }
        IQueryable<SyndicationPerson> Persons { get; }
        IQueryable<SyndicationLink> Links { get; }
        IQueryable<BinarySyndicationContent> Content { get; }

        SyndicationFeed GetFeed(IEnumerable<SyndicationItem> items);
        SyndicationFeed UpdateFeed(SyndicationFeed feedDetails);

        SyndicationItem GetItem(String id);
        SyndicationItem CreateItem(SyndicationItem newItem);
        SyndicationItem UpdateItem(String id, SyndicationItem updatedItem);
        void DeleteItem(String id);

        SyndicationCategory GetCategory(String name);
        SyndicationCategory CreateCategory(SyndicationCategory newCategory);
        SyndicationCategory UpdateCategory(String originalName, SyndicationCategory updatedCategory);
        void DeleteCategory(String name);

        SyndicationPerson GetPerson(String email);
        SyndicationPerson CreatePerson(SyndicationPerson newPerson);
        SyndicationPerson UpdatePerson(String originalEmail, SyndicationPerson updatedPerson);
        void DeletePerson(String email);

        SyndicationLink GetLink(String uri, String relationship);
        SyndicationLink CreateLink(SyndicationLink newLink);
        SyndicationLink UpdateLink(String originalUri, String originalRelationship, SyndicationLink updatedLink);
        void DeleteLink(String uri, String relationship);

        BinarySyndicationContent GetContent(String id);
        BinarySyndicationContent CreateContent(BinarySyndicationContent newContent);
        BinarySyndicationContent UpdateContent(String id, BinarySyndicationContent updatedContent);
        void DeleteContent(String id);
    }
}
